<% layout('/layouts/default.html', {title: '产品档案管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('产品档案管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('st:stProductRecord:edit')){ %>
					<a href="${ctx}/st/stProductRecord/form" class="btn btn-default btnTool" title="${text('新增产品档案')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${stProductRecord}" action="${ctx}/st/stProductRecord/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('产品名称')}：</label>
					<div class="control-inline">
						<#form:input path="productName" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('产品编号')}：</label>
					<div class="control-inline">
						<#form:input path="productCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('产品性质')}：</label>
					<div class="control-inline width-120">
						<#form:select path="productQuality" dictType="st_product_quality" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('产品类型')}：</label>
					<div class="control-inline width-120">
						<#form:select path="productType" dictType="st_product_type" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('动物种类')}：</label>
					<div class="control-inline width-120">
						<#form:select path="animalCategory" dictType="st_animal_category" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('原料编码')}：</label>
					<div class="control-inline">
						<#form:input path="rawMaterialCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('比例')}：</label>
					<div class="control-inline width-120">
						<#form:select path="percentIn" dictType="st_product_percent" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('型号')}：</label>
					<div class="control-inline width-120">
						<#form:select path="model" dictType="st_product_model" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('序号')}：</label>
					<div class="control-inline width-120">
						<#form:select path="number" dictType="st_product_number" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('客户名称')}：</label>
					<div class="control-inline">
						<#form:input path="customName" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('产品系列')}：</label>
					<div class="control-inline width-120">
						<#form:select path="productSeries" dictType="st_product_series" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('包装规格')}：</label>
					<div class="control-inline">
						<#form:input path="packSize" maxlength="10" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('计量单位')}：</label>
					<div class="control-inline">
						<#form:input path="calcUnit" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('辅助单位')}：</label>
					<div class="control-inline">
						<#form:input path="supUnit" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('规格型号')}：</label>
					<div class="control-inline">
						<#form:input path="specification" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('生产厂家')}：</label>
					<div class="control-inline width-120">
						<#form:select path="productMaker" dictType="st_product_maker" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('默认仓位')}：</label>
					<div class="control-inline">
						<#form:input path="defaultWarehouse" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('条码号')}：</label>
					<div class="control-inline">
						<#form:input path="barCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('最低库存')}：</label>
					<div class="control-inline">
						<#form:input path="lowInventory" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('最高库存')}：</label>
					<div class="control-inline">
						<#form:input path="highInventory" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('参考成本')}：</label>
					<div class="control-inline">
						<#form:input path="referenceCost" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('参考进价')}：</label>
					<div class="control-inline">
						<#form:input path="referenceInPrice" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('参考售价')}：</label>
					<div class="control-inline">
						<#form:input path="referenceOutPrice" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验类型')}：</label>
					<div class="control-inline width-120">
						<#form:select path="checkType" dictType="st_check_type" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('保质期')}：</label>
					<div class="control-inline">
						<#form:input path="savedType" maxlength="3" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('有效')}：</label>
					<div class="control-inline">
						<#form:input path="effect" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('批号管理')}：</label>
					<div class="control-inline">
						<#form:input path="batchManage" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="approveState" dictType="st_approve_state" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批人编码')}：</label>
					<div class="control-inline">
						<#form:input path="approveManCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批人')}：</label>
					<div class="control-inline">
						<#form:input path="approveManName" maxlength="5" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("产品名称")}', name:'productName', index:'a.product_name', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/st/stProductRecord/form?id='+row.id+'" class="btnList" data-title="${text("编辑产品档案")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("产品编号")}', name:'productCode', index:'a.product_code', width:150, align:"left"},
		{header:'${text("产品性质")}', name:'productQuality', index:'a.product_quality', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_quality')}, val, '${text("未知")}', true);
		}},
		{header:'${text("产品类型")}', name:'productType', index:'a.product_type', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_type')}, val, '${text("未知")}', true);
		}},
		{header:'${text("动物种类")}', name:'animalCategory', index:'a.animal_category', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_animal_category')}, val, '${text("未知")}', true);
		}},
		{header:'${text("原料编码")}', name:'rawMaterialCode', index:'a.raw_material_code', width:150, align:"left"},
		{header:'${text("比例")}', name:'percentIn', index:'a.percent', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_percent')}, val, '${text("未知")}', true);
		}},
		{header:'${text("型号")}', name:'model', index:'a.model', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_model')}, val, '${text("未知")}', true);
		}},
		{header:'${text("序号")}', name:'number', index:'a.number', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_number')}, val, '${text("未知")}', true);
		}},
		{header:'${text("客户名称")}', name:'customName', index:'a.custom_name', width:150, align:"left"},
		{header:'${text("产品系列")}', name:'productSeries', index:'a.product_series', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_series')}, val, '${text("未知")}', true);
		}},
		{header:'${text("包装规格")}', name:'packSize', index:'a.pack_size', width:150, align:"left"},
		{header:'${text("计量单位")}', name:'calcUnit', index:'a.calc_unit', width:150, align:"left"},
		{header:'${text("辅助单位")}', name:'supUnit', index:'a.sup_unit', width:150, align:"left"},
		{header:'${text("规格型号")}', name:'specification', index:'a.specification', width:150, align:"left"},
		{header:'${text("生产厂家")}', name:'productMaker', index:'a.product_maker', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_maker')}, val, '${text("未知")}', true);
		}},
		{header:'${text("默认仓位")}', name:'defaultWarehouse', index:'a.default_warehouse', width:150, align:"left"},
		{header:'${text("条码号")}', name:'barCode', index:'a.bar_code', width:150, align:"left"},
		{header:'${text("最低库存")}', name:'lowInventory', index:'a.low_inventory', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("最高库存")}', name:'highInventory', index:'a.high_inventory', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("参考成本")}', name:'referenceCost', index:'a.reference_cost', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("参考进价")}', name:'referenceInPrice', index:'a.reference_in_price', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("参考售价")}', name:'referenceOutPrice', index:'a.reference_out_price', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("检验类型")}', name:'checkType', index:'a.check_type', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_check_type')}, val, '${text("未知")}', true);
		}},
		{header:'${text("保质期")}', name:'savedType', index:'a.saved_type', width:150, align:"center"},
		{header:'${text("有效")}', name:'effect', index:'a.effect', width:150, align:"center"},
		{header:'${text("批号管理")}', name:'batchManage', index:'a.batch_manage', width:150, align:"center"},
		{header:'${text("审批状态")}', name:'approveState', index:'a.approve_state', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_approve_state')}, val, '${text("未知")}', true);
		}},
		{header:'${text("审批人编码")}', name:'approveManCode', index:'a.approve_man_code', width:150, align:"left"},
		{header:'${text("审批人")}', name:'approveManName', index:'a.approve_man_name', width:150, align:"left"},
		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('st:stProductRecord:edit')){ %>
				actions.push('<a href="${ctx}/st/stProductRecord/form?id='+row.id+'" class="btnList" title="${text("编辑产品档案")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/st/stProductRecord/delete?id='+row.id+'" class="btnList" title="${text("删除产品档案")}" data-confirm="${text("确认要删除该产品档案吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	shrinkToFit: false,
	ajaxSuccess: function(data){
		
	}
});
</script>